/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.activity.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ykht.proj.activity.entity.VCard;
import com.ykht.proj.activity.entity.VDiscountPlan;
import com.ykht.proj.activity.entity.VOrderCard;
import com.ykht.proj.activity.vo.*;
import com.ykht.proj.coupon.vo.CnShopDisVo;

import java.math.BigDecimal;
import java.util.List;

/**
 * 优惠方案表
 *
 * @author csg
 * @date 2021-05-18 14:26:34
 */
public interface VDiscountPlanService extends IService<VDiscountPlan> {

	/**
	 * 新增优惠方案表，并添加门店列表
	 *
	 * @param vDiscountPlanVo
	 */
	void addVDiscountPlan(VDiscountPlanVo vDiscountPlanVo);

	/**
	 * 修改优惠方案表
	 *
	 * @param vDiscountPlanVo
	 */
	void updateVDiscountPlan(VDiscountPlanVo vDiscountPlanVo);

	/**
	 * 创建群组取门店列表（根据品牌标签, 品牌/门店名, 地址查询,协议类型)
	 *
	 * @param cnGroupShopVoReq
	 * @return
	 */
	Page<CnGroupShopVoReq> getByGroupShop(Page page,CnGroupShopVoReq cnGroupShopVoReq);

	/**
	 * 优惠方案 分页查询
	 * @param page 分页
	 * @param vDiscountPlanVo 条件
	 * @return
	 */
    IPage<VDiscountPlanVo> getVDiscountPlanPage(Page page, VDiscountPlanVo vDiscountPlanVo);

	/**
	 * 通过id删除优惠方案表
	 * @param id
	 */
	void deleteDiscountPlan(Long id);

	/**
	 * 根据协议ID获取  协议和公司详情
	 * @param id
	 * @return
	 */
	VDiscountPlanVo getByIdDiscountPlan(Long id);

    List<VPlanInfo> getPlanInfo(VPlanInfoReq vPlanInfoReq);
    BigDecimal minDiscount(VCard card, VOrderCard orderCard);

    List<CardPlanInfo> getCardPlanInfo(List<CardShopVo> cardShopVoList, List<CnShopDisVo> shopDisVoList);

	List<ShopPlan> planInfoTransform2ShopPlan(List<VPlanInfo> planInfoList, List<CnShopDisVo> shopDisVoList);
}
